package cate.game.activity.serverprogress;

import cate.common.table.d.GDFunc;
import cate.game.activity.base.core.Activity;
import cate.game.activity.base.core.ActivityHandler;

@Activity(relatedFuncIds = {GDFunc.MergeAct.MERGE_ACT_SERVER_TARGET})
public class ServerProgressActivityHandler extends ActivityHandler<ServerProgressActivitySPO, ServerProgressActivity> {
    @Override
    public String getName() {
        return "全服目标";
    }

    @Override
    public ServerProgressActivitySPO buildGlobal() {
        return new ServerProgressActivitySPO();
    }

    @Override
    public ServerProgressActivity buildSingle() {
        return new ServerProgressActivity();
    }

    @Override
    public void onActOpen() {

    }

    @Override
    public void onActClose() {

    }

    /**
     * 添加全服进度
     *
     * @param addNum 进度增量
     */
    public void addGlobalProgress(long addNum) {
        getGlobalData().addProgress(addNum);
    }

    /**
     * 获取全服进度
     */
    public long getGlobalProgress() {
        return getGlobalData().progress;
    }
}
